<div class="" id="login_left">
    <div style="margin:150px auto auto 10px;">
        <ul style="list-style:none;line-height: 30px;">
            <li>1. 使用前先要插入相应基础数据，数据文件在/protect/data/schema.mysql.sql。</li>
            <li>2. 帐号权限由大到小分别为 admin, manager, test, 密码皆为 123456。</li>
            <li>3. 从/doc/目录下解压adminhtml的Gii模板，放入框架的Gii目录，结合Gii将会使后台开发效率大大提高。</li>
            <li>4. 项目地址 http://code.google.com/p/yii-adminhtml/</li>
        </ul>
    </div>
</div>
<div class="" id="login_right">
    <h1><?php echo $this->getActionLabel() ?></h1>
    <div class="form">
        <?php
        $form = $this->beginWidget('CActiveForm', array(
            'id' => 'login-form',
                //'enableAjaxValidation'=>true,
        ));
        ?>

        <div class="row">
            <?php echo $form->labelEx($model, 'username'); ?>
<?php echo $form->textField($model, 'username', array('size' => '32', 'autocomplete' => 'off')); ?>
            <?php echo $form->error($model, 'username', array('class' => 'login_error')); ?>
        </div>
        <div class="row">
            <?php echo $form->labelEx($model, 'password'); ?>
<?php echo $form->passwordField($model, 'password', array('size' => '32', 'autocomplete' => 'off')); ?>
<?php echo $form->error($model, 'password', array('class' => 'login_error')); ?>
            <p class="hint"></p>
        </div>
        <div class="row">
            <?php echo $form->labelEx($model, 'verifyCode'); ?>
            <?php echo $form->textField($model, 'verifyCode', array('size' => '13', 'style' => 'margin-right:5px;')); ?>
            <?php
            $this->widget('CCaptcha', array(
                'showRefreshButton' => false,
                'clickableImage' => true,
                'imageOptions' => array(
                    'id' => 'captcha_img',
                    'style' => 'border:1px #bfbfbf solid;',
                ),
            ));
            ?>
            <?php echo $form->error($model, 'verifyCode', array('class' => 'login_error')); ?>
        </div>

        <div class="row login_buttons">
<?php echo CHtml::submitButton('登录'); ?>
        </div>
<?php $this->endWidget(); ?>
    </div><!-- form -->
</div>

<script type="text/javascript">
    $('input[type=password]').each(function() {
        $(this).empty()
    });
    $('#AdminhtmlLoginForm_verifyCode').focus(function() {
        $.ajax({
            url: "<?php echo Yii::app()->createAbsoluteUrl('admin/privilege/captcha', array('refresh' => 1)) ?>",
            dataType: 'json',
            cache: false,
            success: function(result) {
                $('#captcha_img').attr('src', result['url']);
                $('body').data('captcha.hash', [result['hash1'], result['hash2']]);
                $('#captcha_img').show();
            }
        });
    });
    if ($('#AdminhtmlLoginForm_verifyCode').val() == '')
        $('#captcha_img').hide();
</script>
